Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean way to stop training #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Clean way to stop training #84

wants to merge 1 commit into from

Conversation

AlexisBogroff
Copy link

  • Avoid using sys.exit()
  • Use a boolean instead

Indeed, sys.exit() unexpectedly kills python, rather than properly stopping the script.

- Avoid using sys.exit()
- Use a boolean instead
@@ -162,7 +164,7 @@ def train_model(self):
# if the mean of scores of last 10 episode is bigger than 490
# stop training
if np.mean(scores[-min(10, len(scores)):]) > 490:
sys.exit()
complete = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we just break here? and not use complete flag?

@AlexisBogroff
Copy link
Author

AlexisBogroff commented Nov 6, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants